#ifndef TTEXTEDITDELEGATE_H
#define TTEXTEDITDELEGATE_H

#include <QSqlRelationalDelegate>
#include <QObject>
#include <QWidget>
#include <QPainter>
#include <QMouseEvent>
class tTextEditDelegate : public QSqlRelationalDelegate
{
    Q_OBJECT
public:
    tTextEditDelegate();

    // QAbstractItemDelegate interface
public:
    QWidget *createEditor(QWidget *parent, const QStyleOptionViewItem &option, const QModelIndex &index) const;
    void setEditorData(QWidget *editor, const QModelIndex &index) const;
    void setModelData(QWidget *editor, QAbstractItemModel *model, const QModelIndex &index) const;
    void updateEditorGeometry(QWidget *editor, const QStyleOptionViewItem &option, const QModelIndex &index) const;

    // QAbstractItemDelegate interface
public:
    void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const;
};

#endif // TTEXTEDITDELEGATE_H
